




 /*
 * @Author: 来自火星的码农 15122322+heyzhi@user.noreply.gitee.com
 * @Date: 2025-09-22 22:06:37
 * @LastEditors: 来自火星的码农 15122322+heyzhi@user.noreply.gitee.com
 * @LastEditTime: 2025-10-03 13:43:21
 * @FilePath: /GateServer/src/test/test_server.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

#include "../src/util/global.h"
#include <boost/asio/io_context.hpp>
#include <boost/asio/signal_set.hpp>
#include <csignal>
#include <cstdlib>
#include <exception>
#include <memory>
#include "../src/net/Cserver.h"
int main(){
    try{
        unsigned short port=static_cast<unsigned short>(8080);
        net::io_context ioc{1};
        boost::asio::signal_set signals(ioc,SIGINT,SIGTERM);

        signals.async_wait([&ioc](const boost::system::error_code&error,int signal_number){
            if(error){
                return ;
            }
            ioc.stop();

        });
        std::make_shared<Yizhi::CServer>(ioc,port)->Start();
        ioc.run();
    }
    catch(std::exception& e){
        return EXIT_FAILURE;
    }   
 }